package com.opo5.logisticsmanagement.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.opo5.logisticsmanagement.domain.Depot;
import com.opo5.logisticsmanagement.domain.Locator;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface LocatorDao extends BaseMapper<Locator> {
    /**
     * 静态查询
     * @return
     */
    @Select("SELECT d.id,l.id,l.name,l.capacity from tbs_depot d,tbs_locator l "+
            " where d.name=#{depotName} "+
            " and d.id=l.depot_id"
    )


    /**
     * 根据仓库名称、库位名称、库位容积进行查询
     */
    Depot getAll(String depotName,String locatorName,Integer locatorCapacity);


    /**
     * 根据仓库名称、库位名称查询库位id
     * @param depotName
     * @param locatorName
     * @return
     */
    Locator getLocatorByDepotNameLocatorName(String depotName,String locatorName);
}
